<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      width: 200px;
      height: 100px;
      background-color: pink;
      transition: 1s;
      margin: 200px;
      /* transform-origin: center center; */
      transform-origin: left top;
    }

    .box:hover {
      background-color: red;
      transform: rotate(180deg);
    }
  </style>
</head>
<body>
  <div class="box"></div>
</body>
</html>